API Gateway and WebHooks

The API Gateway allows developers to easily interact with EBMS data from other applications. Quickly read, write, and create EBMS data from applications using a standard API (Application Programming Interface). Valuable CRM, production, scheduling, marketing, reporting, and web tools can interact with back-end EBMS data.  

Webhooks is basically the opposite of the API Gateway.  The API Gateway allows external systems to read EBMS data.  WebHooks allows EBMS to access external systems.  This symmetric process uses web calls to communicate with external systems using standard web calls.

In its simplest form an API allows one application to talk to another application. With the rapid increase in mobile devices and interrelated computing devices, it is increasingly common to access back-end data from user applications using API's. The API Gateway and webhooks combination create the connector technology between EBMS data and the standardized OData REST API.  

API Gateway

EBMS is an OData provider and source which gives 3rd party developers the ability to read and write EBMS data for other applications using a standardized “face”. Data such as customer account info, inventory catalog, and sales invoices are available.  The API Gateway exposes select tables (entities) and fields (properties) so that they can be read, written to, and created using a url or REST API. Within the REST API standardized ODATA is used to query and JSON is used to write. A product like Postman or LINQPad can be used to test specific requests.

Setup and Getting Started

Review www.eaglebusinesssoftware.com/EBMS/Modules/API/Default for setup and getting started instructions.

Entities

Review www.eaglebusinesssoftware.com/ebms/modules/api/Entities for a list of entities.

Code Samples

Review www.eaglebusinesssoftware.com/ebms/modules/api/CodeSamples/ for some code samples.

WebHooks

WebHooks is basically the opposite of the API Gateway.  WebHooks allows EBMS to access external systems.  This symmetric process uses web calls to communicate with external systems using standard protocols.

This is an extension to the OData REST API that enables services on the internet to subscribe to events from EBMS, based  user-configured conditions satisfied in new, updated and/or deleted documents and accounts.  As a convenience, the EBMS client provides a user interface to view, edit and enable  these subscriptions.  Web services manage subscriptions primarily through EBMS' REST API and primary documentation should reside there.

Examples of web call events that be triggered through web hooks:

  1. Invoice over $1000 processed for CASH customer

  2. New item created by EBMS

  3. Service Inventory Item deleted

  4. Retail price was changed

  5. New sale for a salesperson

  6. Sale deleted outside business hours

Select File > System Options > Web Hooks tab from the main EBMS menu to configure webhooks.

Webhooks are launched using the following data found within the Web Hooks tab:

  1. The webhooks process is launched whenever a record is saved within the Table Name.  This table must be the header of the document.   For example in the first example the ARINV table identifies the sales invoice document.  Review EBMS Tables and Fields for information on identifying EBMS files and field names.

  2. Select one or more of the following triggers:

    1. Create: this triggers the webhook when a record is created.

    2. Update: This action triggers the webhook when a record is changed.

    3. Delete:  This action triggers the code when a record such as a customer is deleted.

  3. Enter a Description that identifies the webhook process.  

  4. Enable the Inactive option to disable the webhook without deleting the content.  This option allows the user to conveniently pause the process temporarily.  

  5. Select the proper HTTP web call protocol:  

  6. Add the 3rd party solution's Request Headers.

  7. Select one of the following Condition Expression Type.

    1. CodeBase:  Review Database Expressions for more details on this query language.  

    2. JavaScript:  JavaScript is a common language to customize EBMS.  Review Integrations & Customizing EBMS for some customization examples.

  8. Enter the Condition Expression code.   Review EBMS Tables and Fields to identify EBMS information file and information codes.   Review the webhooks video at the beginning of this section for some condition examples.  

  9. Set one of the following URL Expression Types:

    1. Literal: This calls the exact URL as entered into the URL Expression.

    2. {Field} Replacement:  This option is similar to Literal but the system replaces the field name with the field's previous value.  Because webhooks are triggered when data changes, it may be useful to obtain a field's previous value.  This can be accessed by prefixing the field name with an "@" character, for example, {@INVOICE}.  This prefix option supports string, numeric, and boolean field types.  Review EBMS Tables and Fields to identify EBMS data field names.

    3. CodeBase and JavaScript:  Code can be used to create the URL if necessary.  

  10. Set the URL Expression based on the URL expression type.   

  11. Set the HTTP Payload Type and HTTP Payload Expression.  These settings are needed when you are using a Post or Patch web call as set in step #5.  The Payload Type and HTTP Payload Expression are kept blank for Get or delete web calls.  Review the webhooks video at the beginning of this section for some payload examples.

  12. The system records the Changed By user and Last Changed date of each webhook.  

The webhooks within this table can be created by a 3rd party solution or be manually entered by a technical EBMS user to communicate to the 3rd party solution.

Review Monitoring Tools for more information on the Web Hook monitor.

Security

Review Security > Overview for information on configuring security for these interface tools.